package com.niji.littly_donkey_android.adapter;

import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.makeramen.roundedimageview.RoundedImageView;
import com.niji.littly_donkey_android.R;
import com.niji.littly_donkey_android.bean.Notice;

import java.util.ArrayList;

public class NoticeAdapter extends ArrayAdapter<Notice> {


    private static final String TAG = "NoticeAdapter";

    public NoticeAdapter(Context context, ArrayList<Notice> members)
    {
        super(context,0, members);
    }
    @NonNull
    @Override
    public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
        Notice notice = getItem(position);

        if(convertView == null)
        {
            convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_notice, parent, false);
        }

        TextView noticeTitle = convertView.findViewById(R.id.notice_title);
        TextView noticeMessage = convertView.findViewById(R.id.notice_message);
        TextView noticeTime = convertView.findViewById(R.id.notice_time);
        //thumb.setImageBitmap(BitMap.getInstance().returnBitMap(u.getThumb()));
        noticeTitle.setText(notice.getTitle());
        noticeMessage.setText(notice.getMessage());
        noticeTime.setText(notice.getTime());

        return convertView;
    }

}



